package jm.nj.day08jia.demo01;

import java.util.Scanner;

/*
* next():作用是获取字符串,会被空格截断
* nextLine():获取字符串,不受空格影响,但受nextInt干扰
*
* 注意:
*       灵活使用next()和nextInt()
*
* */
public class Test02 {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个整数");
        int a = sc.nextInt();
        System.out.println("接收的数:"+a);
        System.out.println("请输入字符串:");
        //String s = sc.next();
        String s = sc.nextLine();
        System.out.println("接收的字符串是:"+s);
    }
}
